﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/Base.Master" AutoEventWireup="true" CodeBehind="CommonDataList.aspx.cs" Inherits="Exhibition.Manage.CommonDataList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script type="text/javascript">
        function RowDoubleClick(s, e) {
            // alert(grid.GetFocusedRowIndex());
            var key = s.GetRowKey(e.visibleIndex);
          //  block(key);
            //  grid.GetRowValues(grid.GetFocusedRowIndex(), 'Id', OnGetRowValues);
            Open(key);
            


        }
        function OnGetRowValues(value) {
           // alert(value);
           // block(value);
        }
        function Open(ky) {
            if (ky == undefined) {
                ky = 0;
            }
            YXQ.Manager.OpenDialog("<%=table.Replace("E_","")%>Detail.aspx?id=" + ky, "查看详情", ($(window).width() - 200), $(window).height()-100);
        }

    </script>
    <table cellspacing="0" cellpadding="0" width="100%" class="admintable">
        <tr>
            <td>
                <table cellspacing="0" cellpadding="0" class="admintable01">
                    <tr>
                        <td style="width: 20px;">
                            <img src="../images/carfromtable_01.gif" style="margin-top: 2px;" />
                        </td>
                        <td>
                            <b>位置：</b><asp:Literal ID="ltrTbName" runat="server"></asp:Literal>列表
                        </td>
                        <td style="width: 50px;"></td>
                        <td style="width: 50px;"></td>
                        <td style="width: 15px;"></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table cellpadding="0" cellspacing="0" style="margin-bottom: 5px; margin-top: 5px; margin-left: 14px;">
                    <tr>
                        <td>

                            <input type="button" id="btnAdd" class="bt_wb1" value="添加" runat="server" onclick="Open();" />
                            <%-- <dx:ASPxButton ID="btnAdd" runat="server" Text="添加" OnClick="btnAdd_Click" />--%>
                        </td>
                        <td style="padding-left: 4px">
                            <dx:ASPxButton ID="btnExport" Text="导出" runat="server" OnClick="btnExport_Click">
                            </dx:ASPxButton>
                        </td>
                        <td style="padding-left: 4px">
                            <dx:ASPxButton ID="btnSelAll" runat="server" Text="全选" AutoPostBack="false">
                                <ClientSideEvents Click="function() { grid.SelectAllRowsOnPage() }" />
                            </dx:ASPxButton>
                        </td>
                        <td style="padding-left: 4px">
                            <dx:ASPxButton ID="btnUnSelAll" runat="server" Text="取消全选" AutoPostBack="false">
                                <ClientSideEvents Click="function() { grid.UnselectAllRowsOnPage() }" />
                            </dx:ASPxButton>
                        </td>
                        <td style="padding-left: 4px">
                            <dx:ASPxButton ID="btnDelete" runat="server" Text="删除" OnClick="btnDelete_Click" />
                        </td>
                        <td style="padding-left: 4px">
                            <dx:ASPxButton ID="btnGroup" runat="server" Text="拖动分组" OnClick="btnGroup_Click" />
                        </td>

                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center">
                <dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="False"
                    DataSourceForceStandardPaging="false" ClientInstanceName="grid"
                    OnBeforeColumnSortingGrouping="grid_BeforeColumnSortingGrouping"
                    OnProcessColumnAutoFilter="grid_ProcessColumnAutoFilter" OnCustomColumnDisplayText="grid_CustomColumnDisplayText">
                   
                    <ClientSideEvents  RowDblClick="RowDoubleClick"/>
                     <Settings ShowHorizontalScrollBar="true" VerticalScrollableHeight="320" ShowVerticalScrollBar="true" ShowGroupedColumns="true" ShowFilterRow="true" />
                    <SettingsBehavior AllowMultiSelection="true" AllowFocusedRow="True" AutoExpandAllGroups="true" />
                    <SettingsPager Visible="false">
                    </SettingsPager>
                   
                </dx:ASPxGridView>
                <dx:ASPxPager ID="pager" runat="server" Width="100%" CssClass="dxgvPagerBottomPanel_Aqua"
                    OnPageIndexChanged="pager_PageIndexChanged" ItemsPerPage="15"
                    ShowDefaultImages="False">
                    <FirstPageButton Text="首页" Visible="True">
                    </FirstPageButton>
                    <LastPageButton Text="尾页" Visible="True">
                    </LastPageButton>
                    <NextPageButton Text="下一页" Visible="True">
                    </NextPageButton>
                    <PrevPageButton Text="上一页" Visible="True">
                    </PrevPageButton>
                    <Summary AllPagesText="分页{0} - {1} (总{2}条)" Text="当前第{0}页，共{1}页 (共{2}条)" />
                </dx:ASPxPager>
                <dx:ASPxGridViewExporter ID="gridExport" runat="server" GridViewID="grid">
                </dx:ASPxGridViewExporter>
            </td>
        </tr>
    </table>
    <div id="tbColumn" runat="server" datafield="tbColumn"></div>
     
    <input id="hidIdList" type="hidden" />
    <script type="text/javascript">


        
            function block(cid) {
                var demo = $("#showDemoBox");
                var iframe = demo.find("#iframe");
                if (cid != null || cid != undefined) {
                    iframe.attr("src", "<%=table.Replace("E_","")%>Detail.aspx?id=" + cid+"&day="+new Date());
                } else {
                    iframe.attr("src", "<%=table.Replace("E_","")%>Detail.aspx");
                } 
                $.blockUI({
                    message: demo, css: {
                        width: '1000px',
                        left: ($(window).width() - 1000) / 2 + 'px',
                        height: ($(window).height())+'px',

                    }
                });
            }

            function unblock() {
                $.unblockUI();

            }
            

    </script>
</asp:Content>
